RowContaining Method

       

Returns a value corresponding to the row number of the specified vertical (Y) coordinate of the DataGrid control. Doesn't support named arguments.

Syntax

object.RowContaining coordinate

The RowContaining method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
coordinate Required. A single numeric expression that specifies a vertical coordinate (Y value) based on the coordinate system of the container.

Remarks

The RowContaining method returns a value that corresponds to one of the column indexes of the control specified by object. This value ranges from 0 to the setting of the VisibleRows property -1. This method is useful when working with mouse and drag events when you are trying to determine where the user clicked or dropped another control in terms of a row of the DataGrid control.

If coordinate is outside of the coordinate system of the container, a trappable error occurs.